package com.bite.rabbitmq.rabbitopsdemo.controller;


import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("/producer")
@RestController
public class ProducerController {
    @Autowired
    public RabbitTemplate rabbitTemplate;

    @RequestMapping("/quorum")
    public String quorum() {
        rabbitTemplate.convertAndSend("", "quorum.queue", "quorum test...");

        return "quorum test...";
    }

    @RequestMapping("/haproxy")
    public String haproxy() {
        rabbitTemplate.convertAndSend("", "cluster.queue", "haproxy test...");

        return "haproxy test...";
    }
}
